home *** CD-ROM | disk | FTP | other *** search
/ Developer Helper 1: Phil & Dave's Excellent CD / Excellent CD HFS.raw / Moof / Goodies / MPW Goodies / Interfaces / RIncludes / Cmdo.r next >
Text File  |  1988-11-30  |  14KB  |  377 lines

  1. /*
  2.     C M D O . R    - Resource description file for building Commando resources.
  3.                      Copyright Apple Computer, Inc.  1986, 1987
  4.                      All rights reserved.
  5. */
  6.  
  7. #define    FilesID                        0
  8. #define    MultiFilesID                1
  9. #define    CheckOptionID                2
  10. #define    RadioButtonsID                3
  11. #define    RegularEntryID                4
  12. #define    MultiRegularEntryID            5
  13. #define    BoxID                        6
  14. #define    TextBoxID                    7
  15. #define    PopUpID                        8
  16. #define    NestedDialogID                9
  17. #define    TextTitleID                    10
  18. #define    RedirectionID                11
  19. #define    EditPopUpID                    12
  20. #define    TriStateButtonsID            13
  21. #define    ListID                        14
  22. #define    PictOrIconID                15
  23. #define    DummyID                        16
  24. #define    DoItButtonID                17
  25. #define    VersionDialogID                18
  26.  
  27. #define    CMDOVersion                    8
  28.  
  29. /*        The following are used to set styles, simply add for desired style.
  30. */
  31. #define bold            1
  32. #define italic            2
  33. #define underline        4
  34. #define outline         8
  35. #define shadow            16
  36. #define condense        32
  37. #define extend            64
  38.  
  39. type 'cmdo' {
  40.   integer = CMDOVersion;                                    /* Version number */
  41.   integer = $$CountOf(dialogs);                                /* # of dialogs, at least 1 */
  42.   array dialogs {
  43.     integer;                                                /* height of the dialog */
  44.     cstring;                                                /* text displayed in help window */
  45.     align word;
  46.  
  47.     integer = $$CountOf(itemArray);                            /* # of items */
  48.     
  49.     /* The order in which Commando writes out the options is the same order in which the
  50.        items in this array are entered in your resource declaration.  This is important
  51.        for those commands which have position dependent parameters. */
  52.        
  53.     wide array itemArray {
  54.         switch {
  55.             case NotDependent:
  56.                 key int = 0;
  57.             
  58.             case Or:
  59.                 key byte = 1;
  60.                 byte = $$CountOf(OrArray);
  61.                 wide array OrArray {
  62.                     int;                                    /* item number dependent upon */
  63.                 };
  64.             
  65.             case And:
  66.                 key byte = 2;
  67.                 byte = $$CountOf(AndArray);
  68.                 wide array AndArray {
  69.                     int;                                    /* item number dependent upon */
  70.                 };
  71.         };
  72.         switch {
  73.             case Files:
  74.                 key byte = FilesID;
  75.                 byte    InputFile,                            /* These types require the  */
  76.                         InputFileOrDir,                        /* 'Additional' case below. */
  77.                         InputOrOutputFile,
  78.                         InputOrOutputOrDir,
  79.                         
  80.                         OutputFile,                            /* These types require the  */
  81.                         OutputFileOrDir,                    /* 'NoMore' case below.     */
  82.                         DirOnly;
  83.                 switch {
  84.                     case OptionalFile:
  85.                         /* Using this case makes a popup with two or three items.
  86.                            This first item is used to select a default file or to
  87.                            select no file.  The second (and third) item(s) are used
  88.                            to select input or output files. */
  89.                         key int = 0;
  90.                         rect;                                /* bounds of title */
  91.                         rect;                                /* bounds of display box */
  92.                         cstring;                            /* title */
  93.                         cstring;                            /* default file */
  94.                         cstring;                            /* option to return before file */
  95.                         cstring;                            /* If this item is dependent upon
  96.                                                                another Files item, an extension
  97.                                                                can be specified here to be added
  98.                                                                to the dependents file. */
  99.                         cstring;                            /* help text for popup */
  100.                         byte        dim, dontDim;            /* Normally, dependent items are
  101.                                                                dimmed if the parent is disabled,
  102.                                                                if this field is "dontDim", then
  103.                                                                this item won't be dimmed */
  104.                         /* These next three strings are the strings displayed in the popup.  Most
  105.                            of the file types have only two strings but InputOrOutputFile and 
  106.                            InputOrOutputOrDir require three strings.  If a string is set to "",
  107.                            Commando will use a built-in default. */
  108.                         cstring;                            /* popup item #1 */
  109.                         cstring;                            /* popup item #2 */
  110.                         cstring;                            /* popup item #3 */
  111.                 
  112.                     case RequiredFile:
  113.                         /* Using this case makes a button that goes directly to standard
  114.                            file.  Use this case when a file is required and the user doesn't
  115.                            have the choice of a default file or no file. */
  116.                         key int = 1;
  117.                         rect;                                /* bounds of button */
  118.                         cstring;                            /* title of button */
  119.                         cstring;                            /* option to return before file */
  120.                         cstring;                            /* help text for button */
  121.                 };
  122.                 
  123.                 /* Some file types take additional information.  See the comment next to the
  124.                    file types to find out which case to choose here. */
  125.                 switch {
  126.                     case Additional:
  127.                         key    byte = 0;
  128.                         cstring;                                    /* For InputOrOutputFile, an option
  129.                                                                        can be specified when a new
  130.                                                                        (or output) file is chosen. */
  131.                         cstring    FilterTypes = ":";                    /* preferred file extension (i.e. ".c") 
  132.                                                                        If null, no radio buttons will be
  133.                                                                        displayed.  If FilterTypes is used,
  134.                                                                        the radio buttons will toggle
  135.                                                                        between showing files only with
  136.                                                                        the types below and all files */
  137.                         cstring;                                    /* title of only files button */
  138.                         cstring;                                    /* title of all files button */
  139.                         byte = $$CountOf(TypesArray);                /* up to 4 types may be specified */
  140.                         align word;
  141.                         array TypesArray {
  142.                             literal longint        text = 'TEXT',        /* desired input file type, specify */
  143.                                                 obj  = 'OBJ ',        /* no type for all types */
  144.                                                 appl = 'APPL',
  145.                                                 da   = 'DFIL',
  146.                                                 tool = 'MPST';
  147.                         };
  148.  
  149.                     case NoMore:
  150.                         key    byte = 1;
  151.                 };
  152.  
  153.             case MultiFiles:
  154.                 key byte = MultiFilesID;
  155.                 cstring;                                    /* button title */
  156.                 cstring;                                    /* help text for button */
  157.                 align word;
  158.                 rect;                                        /* bounds of button */
  159.                 cstring;                                    /* message like " Source files to compile: " */
  160.                 cstring;                                    /* option returned before each 
  161.                                                                filename. Can be null */
  162.                 switch {
  163.                     case MultiInputFiles:
  164.                         key byte = 0;
  165.                         byte = $$CountOf(MultiTypesArray);            /* up to 4 types may be specified */
  166.                         align word;
  167.                         array MultiTypesArray {
  168.                             literal longint        text = 'TEXT',        /* desired input file type, specify no type */
  169.                                                 obj  = 'OBJ ',        /* for all types */
  170.                                                 appl = 'APPL',
  171.                                                 da   = 'DFIL',
  172.                                                 tool = 'MPST';
  173.                         };
  174.                         cstring    FilterTypes = ":";                    /* preferred file extension (i.e. ".c") 
  175.                                                                        If null, no radio buttons will be
  176.                                                                        displayed.  If FilterTypes is used,
  177.                                                                        the radio buttons will toggle
  178.                                                                        between showing files only with
  179.                                                                        the types below and all files */
  180.                         cstring;                                    /* title of only files button */
  181.                         cstring;                                    /* title of all files button */
  182.             
  183.                     case MultiDirs:
  184.                         key byte = 1;
  185.  
  186.                     case MultiInputFilesAndDirs:
  187.                         key byte = 2;
  188.  
  189.                     case MultiOutputFiles:
  190.                         key byte = 3;
  191.                 };
  192.  
  193.             case CheckOption:
  194.                 key byte = CheckOptionID;
  195.                 byte    NotSet, Set;                        /* whether button is set or not */
  196.                 rect;                                        /* bounds */
  197.                 cstring;                                    /* title */
  198.                 cstring;                                    /* option returned */
  199.                 cstring;                                    /* help text for button */
  200.             
  201.             case RadioButtons:
  202.                 key byte = RadioButtonsID;
  203.                 byte = $$CountOf(radioArray);                /* # of buttons */
  204.                 wide array radioArray {
  205.                     rect;                                    /* bounds */
  206.                     cstring;                                /* title */
  207.                     cstring;                                /* option returned */
  208.                     byte    NotSet, Set;                    /* whether button is set or not */
  209.                     cstring;                                /* help text for button */
  210.                     align word;
  211.                 };
  212.             
  213.             case RegularEntry:
  214.                 key byte = RegularEntryID;
  215.                 cstring;                                    /* title */
  216.                 align word;
  217.                 rect;                                        /* bounds of title */
  218.                 rect;                                        /* bounds of input box */
  219.                 cstring;                                    /* default value */
  220.                 byte        ignoreCase, keepCase;            /* the default value is never displayed
  221.                                                                in the commando window.  If what the
  222.                                                                user types in the textedit window
  223.                                                                matches the default value, then that
  224.                                                                value isn't displayed.  This flag
  225.                                                                tells Commando whether to ignore case
  226.                                                                when comparing the contents of the textedit
  227.                                                                window with the default value. */
  228.                 cstring;                                    /* option returned */
  229.                 cstring;                                    /* help text for entry */
  230.  
  231.             case MultiRegularEntry:    /* For scrollable, lists of an option */
  232.                 key byte = MultiRegularEntryID;
  233.                 cstring;                                    /* title */
  234.                 align word;
  235.                 rect;                                        /* bounds of title */
  236.                 rect;                                        /* bounds of input list */
  237.                 byte = $$CountOf(DefEntryList);
  238.                 array DefEntryList {
  239.                     cstring;                                /* default values */
  240.                 };
  241.                 cstring;                                    /* option returned. Each value
  242.                                                                will be preceded with this
  243.                                                                option */
  244.                 cstring;                                    /* help text for entry */
  245.  
  246.             case Box:        /* Can be used to draw lines too */
  247.                 key byte = BoxID;
  248.                 byte            black, gray;                /* color of object */
  249.                 rect;                                        /* bounds of box or line */
  250.                 
  251.             case TextBox:    /* Draws a box with title in upper-left */
  252.                 key byte = TextBoxID;
  253.                 byte            black, gray;                /* color of object */
  254.                 rect;                                        /* bounds of box or line */
  255.                 cstring;                                    /* title */
  256.                 
  257.             case TextTitle:
  258.                 key byte = TextTitleID;
  259.                 byte        plain;                            /* style of text */            
  260.                 rect;                                        /* bounds of title */
  261.                 int            systemFont;                        /* font number to use */
  262.                 int            systemSize;                        /* font size to use */
  263.                 cstring;                                    /* the text to display */
  264.             
  265.             case PopUp:
  266.                 key byte = PopUpID;
  267.                 byte        Window, Alias, Font, Set;        /* popup type */
  268.                 rect;                                        /* bounds of title */
  269.                 rect;                                        /* bounds of popup line */
  270.                 cstring;                                    /* title */
  271.                 cstring;                                    /* option returned */
  272.                 cstring;                                    /* help text for popup */
  273.                 byte        noDefault, hasDefault;            /* hasDefault if first item is "Default Value" */
  274.  
  275.             case EditPopUp:
  276.                 key byte = EditPopUpID;
  277.                 /* For MenuItem, this EditPopUp must be dependent upon another EditPopUp
  278.                    of the MenuTitle type so that the control knows whose menu items to
  279.                    display.
  280.                    
  281.                    For FontSize, this EditPopUp must be dependent upon a PopUp of the
  282.                    Font type so that the control knows what sizes of the font exist. */
  283.                    
  284.                 byte     MenuTitle, MenuItem,                /* Type of editable pop-up */
  285.                         FontSize, Alias, Set;
  286.                 rect;                                        /* bounds of title */
  287.                 rect;                                        /* bounds of text edit area */
  288.                 cstring;                                    /* title */
  289.                 cstring;                                    /* option to return */
  290.                 cstring;                                    /* help text for textedit part */
  291.                 cstring;                                    /* help text for popup part */
  292.                 
  293.             case NestedDialog:
  294.                 key    byte = NestedDialogID;
  295.                 byte;                                        /* the number of the dialog
  296.                                                                to call.  It must be greater
  297.                                                                than the current dialog */
  298.                 rect;                                        /* bounds of button */
  299.                 cstring;                                    /* button's title */
  300.                 cstring;                                    /* help text for button */
  301.             
  302.             case Redirection:
  303.                 key byte = RedirectionID;
  304.                 byte    StandardOutput, DiagnosticOutput,    /* the type of redirection */
  305.                         StandardInput;
  306.                 point;                                        /* upper-left point of the whole contraption */
  307.  
  308.             case TriStateButtons:
  309.                 key byte = TriStateButtonsID;
  310.                 byte = $$CountOf(threeStateArray);            /* # of buttons */
  311.                 cstring;                                    /* option returned */
  312.                 wide array threeStateArray {
  313.                     align word;
  314.                     rect;                                    /* bounds */
  315.                     cstring;                                /* title */
  316.                     cstring;                                /* string for Clear state */
  317.                     cstring;                                /* string for DontTouch state */
  318.                     cstring;                                /* string for Set state */
  319.                     cstring;                                /* help text for button */
  320.                 };
  321.  
  322.             case List:        /* Puts up a list of "things" and allows multiple selections */
  323.                 key byte = ListID;
  324.                 byte        Volumes, ShellVars,
  325.                             Windows, Aliases;                /* what to display in the list */
  326.                 cstring;                                    /* option to return before each "thing" */
  327.                 cstring;                                    /* title */
  328.                 align word;
  329.                 rect;                                        /* bounds of title */
  330.                 rect;                                        /* bounds of list selection box */
  331.                 cstring;                                    /* help text for selection box */
  332.  
  333.             case PictOrIcon:
  334.                 key byte = PictOrIconID;
  335.                 byte    Icon, Picture;                        /* display a picture or icon */
  336.                 int;                                        /* resource id of icon/picture */
  337.                 rect;                                        /* display bounds */
  338.  
  339.             case Dummy:
  340.                 key byte = DummyID;
  341.  
  342.             case DoItButton:                                /* Allows the 'do it' button to be dependent */
  343.                 key byte = DoItButtonID;
  344.  
  345.             case VersionDialog:                                /* Display a dialog when the version # is clicked */
  346.                 key byte = VersionDialogID;
  347.                 switch {
  348.                     case VersionString:                        /* Version string embedded right here */
  349.                         key byte = 0;
  350.                         cstring;                            /* Version string of tool (e.g. V2.0) */
  351.                     
  352.                     case VersionResource:                    /* Versions string comes from another resource */
  353.                         key byte = 1;
  354.                         literal longint;                    /* resource type of pascal string containing version string */
  355.                         integer;                            /* resource id of version string */
  356.                 };
  357.                 cstring;                                    /* Version text for help window */
  358.                 align word;
  359.                 integer        noDialog;                        /* Rsrc id of 'DLOG' */
  360.                     /* NOTE •1: if there is no modal dialog to display when the version
  361.                        string is clicked, set the rsrc id to zero (noDialog).
  362.  
  363.                        NOTE •2: if the version string comes from another resource (VersionResource),
  364.                        the string must be the first thing in the resource and the string must be 
  365.                        a pascal-style string.  A 'STR ' resource is an example of a resource that
  366.                        fits the bill.
  367.                        
  368.                        NOTE •3: if the modal dialog is to have a filter proc, the proc
  369.                        must be linked as a 'fltr' resource with the same resource id
  370.                        as the dialog. */
  371.         };
  372.         align word;
  373.     };
  374.     align word;
  375.   };
  376. };
  377.